package com.kid.keep.enums;

import com.google.common.collect.Lists;
import lombok.Getter;
import org.nfunk.jep.function.Str;

import java.util.List;

/**
 * @Description 报告等级
 * @Author JOHN
 * @Create 2019-12-08
 * @Since 1.0.0
 */
public enum ReportGradeEnum {
    FLUNK(Lists.newArrayList(3, 2, 1, 0), "较弱"),
    PASS(Lists.newArrayList(4), "达标"),
    GOOD(Lists.newArrayList(5), "良好"),
    EXCELLENT(Lists.newArrayList(6), "优秀");

    @Getter
    private List<Integer> value;

    @Getter
    private String message;


    ReportGradeEnum(List<Integer> value, String message) {
        this.value = value;
        this.message = message;

    }

    public static String getMessage(Integer v){
        for (ReportGradeEnum reportGradeEnum : ReportGradeEnum.values()) {
            if (reportGradeEnum.value.contains(v)) {
                return reportGradeEnum.message;
            }
        }
        return FLUNK.message;
    }

}
